#ifndef __CAN_COMMON_H
#define __CAN_COMMON_H
#ifdef __cplusplus
extern "C"{
#endif

#include <rtthread.h>
#include <rtdevice.h>

extern rt_device_t can1_bus;            /* CAN 设备句柄 */
extern rt_device_t can2_bus;

typedef struct 
{
    rt_device_t *can_handle;              // can句柄
    struct rt_can_msg txmsg;              // CAN报文发送配置
    uint32_t tx_id;                       // 发送id
    uint32_t rx_id;                       // 接收id
} CanMessage_t;


typedef struct
{
    rt_device_t *can_handle;              // can句柄
    uint32_t tx_id;                       // 发送id
    uint32_t rx_id;                       // 接收id
} CanMessage_Init_t;

void can_send(rt_device_t can_bus, struct rt_can_msg *msg);

#ifdef __cplusplus
}
#endif

#endif // CAN_COMMON_H